package dao.impl;

import dao.AccountDao;
import domain.Account;
import org.apache.ibatis.session.SqlSession;
import utils.SqlSessionUtil;

public class AccountDaoImpl implements AccountDao {
    @Override
    public Account selectById(Integer id) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        Account account = sqlSession.selectOne("selectById", id);
        return account;
    }

    @Override
    public void updateAccount(Account account) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        sqlSession.update("updateAccount",account);
    }
}
